<?php
namespace Admin\Model;
use Think\Model\RelationModel;

    class ActorModel extends RelationModel
    {

        //自动验证
        protected $_validate = array(
            array('aname','require','角色名不能为空'),
        );


        protected $_link = array(
            'role'=>array(
                'mapping_type'=>self::MANY_TO_MANY,
                'relation_table'=>'hx_actor_role',
                'foreign_key'=> 'actor_id',
                'relation_foreign_key'=> 'role_id',
                'mapping_fields'=>'id',
            ),
        );
    }
